package a.i.a;

import a.c.e;
import a.c.k;
import a.c.q;
import a.c.*;

public class a
  implements m
{
  private x a = null;
  private boolean b = false;
  private z[] c = null;
  private z d = null;
  private a_[] e = null;
  private e f = null;
  private int g = 0;
  private q h;
  public static int i;
  
  public a(q paramq, int paramInt)
  {
    x localx = paramq.B();
    a(paramq, localx, paramInt);
    this.b = true;
  }
  
  public a(q paramq, k paramk)
  {
    this.a = paramq.B();
    int j = 0;
    w localw = paramq.v();
    while (localw.e())
    {
      int k = paramk.getInt(localw.d());
      j = Math.max(k, j);
      if (bool2) {
        break label160;
      }
      localw.f();
      if (bool1) {
        break label153;
      }
      if (bool1)
      {
        if (bool2) {
          break label169;
        }
        if (!bool2) {}
        q.n = !q.n;
      }
    }
    a(paramq, this.a, j);
    label153:
    label160:
    localw = this.h.v();
    label169:
    if (localw.e()) {}
    while (bool2)
    {
      a(localw.d(), paramk.getInt(localw.d()));
      localw.f();
      if ((!bool2) && (bool1)) {
        break label228;
      }
      if (!bool1) {
        break;
      }
    }
    this.b = true;
    label228:
    if (bool2) {
      q.o = !q.o;
    }
  }
  
  public a(q paramq, x paramx, int paramInt)
  {
    a(paramq, paramx, paramInt);
    this.b = false;
  }
  
  private void a(q paramq, x paramx, int paramInt)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    this.h = paramq;
    this.a = paramx;
    this.c = new z[paramInt + 1];
    this.f = null;
    this.d = new z();
    this.e = new a_[this.h.k()];
    int j = 0;
    z localz = new z();
    w localw = this.h.v();
    do
    {
      while (!bool1)
      {
        if (!localw.e()) {
          break;
        }
        this.e[j] = new a_(localw.d(), localz);
        j++;
        localw.f();
      }
    } while (bool2);
  }
  
  public void d()
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    y localy = this.d.h();
    if (localy.e()) {}
    do
    {
      e locale = (e)localy.j();
      this.c[this.a.getInt(locale)].clear();
      this.e[locale.f()].d = false;
      localy.f();
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool1) {
        break;
      }
      this.d.clear();
    } while (bool2);
    this.f = null;
  }
  
  public boolean a()
  {
    if (!d.e) {}
    return this.d.size() == 0;
  }
  
  public boolean a(e parame)
  {
    return this.e[parame.f()].d;
  }
  
  public void a(e parame, int paramInt)
  {
    int j = parame.f();
    this.a.a(parame, paramInt);
    this.e[j].d = true;
    z localz = a(paramInt);
    localz.a(this.e[j].a);
    this.d.a(this.e[j].b);
    if (!d.e)
    {
      if ((this.f == null) || (paramInt < this.g)) {
        this.f = parame;
      }
    }
    else {
      this.g = paramInt;
    }
  }
  
  public void c(e parame)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    int j = parame.f();
    this.e[j].d = false;
    z localz = this.c[this.a.getInt(parame)];
    localz.h(this.e[j].a);
    this.d.h(this.e[j].b);
    if (!bool2) {
      if (this.d.size() > 0)
      {
        do
        {
          if (this.g >= this.c.length) {
            break;
          }
          if (bool1) {
            break label184;
          }
          if ((bool2) || (this.c[this.g] != null))
          {
            if (!bool2) {
              if (this.c[this.g].size() > 0) {
                break;
              }
            }
          }
          else {
            this.g += 1;
          }
        } while (!bool1);
        this.f = ((e)this.c[this.g].a());
        if (bool2) {
          return;
        }
        label184:
        if (this.e[this.f.f()].d) {
          return;
        }
        throw new RuntimeException("Consistency check failed: Tried to make " + this.f + " with " + this.g + " to new minimal node which is not part of the actual list !");
      }
    }
    this.f = null;
  }
  
  public e b()
  {
    return this.f;
  }
  
  public void b(e parame, int paramInt)
  {
    z localz = this.c[this.a.getInt(parame)];
    v localv = this.e[parame.f()].a;
    localz.h(localv);
    a(paramInt).a(localv);
    this.a.a(parame, paramInt);
    if (!d.e)
    {
      if (paramInt < this.g) {
        this.f = parame;
      }
    }
    else {
      this.g = paramInt;
    }
  }
  
  public void c(e parame, int paramInt)
  {
    boolean bool2 = d.e;
    boolean bool1 = d.d;
    int j = this.a.getInt(parame);
    z localz = this.c[j];
    v localv = this.e[parame.f()].a;
    localz.h(localv);
    if (!bool2)
    {
      a(paramInt).a(localv);
      this.a.a(parame, paramInt);
      if (parame != this.f) {}
    }
    else
    {
      if (localz.isEmpty()) {}
      for (;;)
      {
        if (!bool2)
        {
          localz = this.c[(++j)];
          if (!bool1)
          {
            if (!bool1) {
              break;
            }
            if (bool2) {
              continue;
            }
            this.f = ((e)localz.a());
          }
        }
      }
      this.g = j;
    }
  }
  
  public void d(e parame, int paramInt)
  {
    boolean bool = d.e;
    int j = b(parame);
    if (!bool) {
      if (paramInt < j) {
        b(parame, paramInt);
      }
    }
    if (((bool) || (d.d)) && (j > paramInt)) {
      c(parame, paramInt);
    }
  }
  
  public e c()
  {
    e locale = this.f;
    c(locale);
    return locale;
  }
  
  public int b(e parame)
  {
    return this.a.getInt(parame);
  }
  
  public void e()
  {
    if ((d.e) || (this.b)) {
      this.h.a(this.a);
    }
  }
  
  protected z a(int paramInt)
  {
    if (!d.e) {
      if (this.c[paramInt] == null) {
        this.c[paramInt] = new z();
      }
    }
    return this.c[paramInt];
  }
  
  static class a_
  {
    v a = null;
    v b = null;
    boolean d;
    
    a_(e parame, z paramz)
    {
      this.b = paramz.b(parame);
      this.a = paramz.b(parame);
      paramz.h(this.b);
      paramz.h(this.a);
      paramz.clear();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.i.a.a

 * JD-Core Version:    0.7.0.1

 */